package org.runecore.rs2.model;

import org.runecore.rs2.model.mask.EntityMask;

/**
 * RuneCore
 * Sep 4, 2011
 * @author Harry Andreas<Harry@RuneCore.org>
 */
public abstract class Entity {
	
	/**
	 * The index of the <code>Entity</code> 
	 */
	private int index;
	
	/**
	 * Variables for directions
	 */
	private int primaryDirection, secondaryDirection;
	
	/**
	 * The <code>Location</code> of the entity
	 */
	private Location location;
	
	/**
	 * The <code>Location</code> for the current region
	 */
	private Location currentRegion;
	
	/**
	 * The <code>EntityMask</code> for the <code>Entity</code>
	 */
	private transient EntityMask entityMask;
	
	/**
	 * Constructor
	 */
	public Entity() {
		setLocation(Location.create(3087, 3490, 0));
		setEntityMask(new EntityMask(this));
	}
	
	public void setupEntity() {
		setEntityMask(new EntityMask(this));
	}
	
	/**
	 * Update's the <code>Entity</code>
	 */
	public abstract void update();
	
	/**
	 * Executes the <code>Entity</code>'s 
	 * tick process
	 */
	public abstract void tick();

	/**
	 * @param index the index to set
	 */
	public void setIndex(int index) {
		this.index = index;
	}

	/**
	 * @return the index
	 */
	public int getIndex() {
		return index;
	}

	/**
	 * @param location the location to set
	 */
	public void setLocation(Location location) {
		this.location = location;
	}

	/**
	 * @return the location
	 */
	public Location getLocation() {
		return location;
	}

	/**
	 * @param currentRegion the currentRegion to set
	 */
	public void setCurrentRegion(Location currentRegion) {
		this.currentRegion = currentRegion;
	}

	/**
	 * @return the currentRegion
	 */
	public Location getCurrentRegion() {
		return currentRegion;
	}

	/**
	 * @param entityMask the entityMask to set
	 */
	public void setEntityMask(EntityMask entityMask) {
		this.entityMask = entityMask;
	}

	/**
	 * @return the entityMask
	 */
	public EntityMask getEntityMask() {
		return entityMask;
	}

	/**
	 * @return the primaryDirection
	 */
	public int getPrimaryDirection() {
		return primaryDirection;
	}

	/**
	 * @param primaryDirection the primaryDirection to set
	 */
	public void setPrimaryDirection(int primaryDirection) {
		this.primaryDirection = primaryDirection;
	}

	/**
	 * @return the secondaryDirection
	 */
	public int getSecondaryDirection() {
		return secondaryDirection;
	}

	/**
	 * @param secondaryDirection the secondaryDirection to set
	 */
	public void setSecondaryDirection(int secondaryDirection) {
		this.secondaryDirection = secondaryDirection;
	}

}